package com.simon.hse.activity.safe.safework;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.simon.hse.R;
import com.simon.hse.activity.BaseActivity;
import com.simon.hse.activity.SignActivity;
import com.simon.hse.activity.safe.jobticket.commonly.CommonlyDetailsActivity;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;
import org.xutils.view.annotation.ViewInject;

/**
 * 申请作废作业许可证
 */
@ContentView(R.layout.activity_approval_cancel_work_permit)
public class ApprovalCancelWorkPermitActivity extends BaseActivity {
    @ViewInject(R.id.tv_common_title)
    TextView mTv_common_title;
    @ViewInject(R.id.tv_title2)
    TextView tvTitle2;
    String from;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        try {
            from = getIntent().getStringExtra("from");
        } catch (Exception e) {

        }
        switch (from) {
            case "jsaEffective":
                mTv_common_title.setText("申请取消作业许可证");
                break;
            case "jsaCancel":
                mTv_common_title.setText("申请取消JSA分析");
                break;
            case "workSafePlanEffective":
                mTv_common_title.setText("申请作废作业许可证");
                break;
            case "workSafePlanCancel":
                mTv_common_title.setText("申请作废作业许可证");
                break;
            case "commonlyEffective":
                mTv_common_title.setText("关闭作业许可证");
                break;
            case "simpleEffective":
                mTv_common_title.setText("关闭作业许可证");
                break;
            case "commonlyOverdue":
                mTv_common_title.setText("关闭作业许可证");
                break;
            case "simpleOverdue":
                mTv_common_title.setText("关闭作业许可证");
                break;
            case "commonlyCancelApproval":
                mTv_common_title.setText("一般吊装作业许可证取消审批");
                tvTitle2.setText("审批意见");
                break;
            case "simpleCancelApproval":
                mTv_common_title.setText("简易吊装作业许可证取消审批");
                tvTitle2.setText("审批意见");
                break;
            case "commonlyCancelQuery":
                mTv_common_title.setText("一般吊装作业许可证取消申请");
                tvTitle2.setText("取消原因");
                break;
            case "simpleCancelQuery":
                mTv_common_title.setText("简易吊装作业许可证取消申请");
                tvTitle2.setText("取消原因");
                break;
            default:
                mTv_common_title.setText("申请作废作业许可证");
                break;
        }
    }

    @Event(value = {R.id.iv_common_left, R.id.tv_train_record_cancel, R.id.tv_train_record_confirm})
    private void finish(View view) {
        switch (view.getId()) {
            case R.id.iv_common_left:
                break;
            case R.id.tv_train_record_cancel:
                finish();
                break;
            case R.id.tv_train_record_confirm:
                startActivity(new Intent(ApprovalCancelWorkPermitActivity.this, SignActivity.class));
                break;
        }
    }
}
